package com.huarui.companypackage.service;

import java.util.List;

import org.ewaf.framework.model.PagingInfo;
import org.ewaf.framework.service.BaseService;

import com.huarui.companypackage.dao.IServiceDao;
import com.huarui.companypackage.model.Service;

/**
 * 服务servcie
 * 
 * @author Administrator
 * 
 */
public class ServerService extends BaseService {

	private IServiceDao getDao() {
		return (IServiceDao) dao;
	}

	public void addService(Service service) {
		this.dao.create(service);
	}

	public void modifyService(Service service) {
		this.dao.update(service);
	}

	public List<Service> getSelectableService(Integer selectable) {
		return getDao().getSelectableService(selectable);
	}

	public void queryServiceInfos(PagingInfo<Service, Service> paginInfo) {
		IServiceDao dao = this.getDao();
		List<Service> items = dao.selectServices(paginInfo.getCondition(), paginInfo.getSummary());
		int total = dao.selectServicesCount(paginInfo.getCondition());
		paginInfo.setItems(items);
		paginInfo.setTotal(total);
	}

}
